A1+ABM+Legal: 전수조사 4 HIGH + 다수 MED fix (NULL/매핑/RAG/검증)#196
Merged
Conversation
전수조사 (2026-05-05) 4 영역 (DB/업종/ABM/법률) 발견 문제 fix. 3 병렬 sub-agent 작업 통합. ## ABM 시뮬 (simulation/) - C1 male/female_70_74 NULL 컬럼 회피 + COALESCE 가드 (profile_builder.py) → AGE_BUCKETS '70_plus' 단일 사용, NULL 회귀 방지 주석 고정 - C2 apt_trade_real ILIKE 매핑 강화 (profile_builder.py:201-282) → 망원2동/성산2동 명시 + neighbor_groups 인접 동 평균 fallback (income default 0.5 silent fail 차단) - C3 kakao_store.brand_name NULL 72.8% → cannibalization brand 매칭 명시 skip → Store.brand_name field 추가, skipped_no_brand 카운터로 silent 0 가시화 - C4 living_population_grid vs legacy fallback key 형식 통일 (world_loader/runner) → _TIME_ZONE_TO_HOURS 매핑으로 6구간 → 24h 확장, daily boost dict swap 정합 ## 법률 (agents/legal/) - D1 RAG 0-row 폭발 차단 (4 specialist) → rag_empty 플래그 + LLM prompt 에 caution 강제 directive + post-LLM safe→caution floor - D2 FTC churn_rate frcsCnt=NULL 의미 손상 fix (legal.py) → max(0,1) 트릭 제거, frcsCnt is None or store_count<=0 시 churn_rate=None → 소비자 코드: None → caution + summary "데이터 부족" 명시 - D3 school_zone mock 5개 위험 docstring 알림 (rules.py) - D4 territory_radius_m 50~1500m 범위 검증 (specialists.py) → 범위 외/파싱 실패 시 None fallback + warning 로그 - D5 cache key brand_name 정규화 (legal.py) → 공백/대소문자/lower 통합 (Starbucks/starbucks/STARBUCKS 동일 키) ## DB / dong_resolver / schemas - E2 dong_resolver SoT 통합 (services/dong_resolver.py) → MAPO_DONG_MAP 단일 source. population_api / demographic_depth 가 import 하도록 - E3 resolve_dong_code(name, default=None) 시그니처 + resolve_dong_code_or_default helper - E4 get_dong_centroid 마포 한정 docstring 명시 (commercial_intelligence) - B1 SimulationInput Pydantic 검증 강화 (simulation_input.py) → business_type 28종 화이트리스트 (silent fail 차단 1단계, 강격 strict Literal 은 별 PR) → lat/lon 마포 bbox 범위 (37.50~37.65, 126.85~126.95) → 빈 business_type 차단 ## 검증 - ruff check/format 통과 (수정 파일 한정) - 모든 모듈 import OK - 기존 테스트 통과 (test_legal_orchestrator 12 + test_runner_day_loop_boost 3 + test_living_pop_loader 3 + test_vacancy_pse_brand 4) - 호출자 backward compat 검증 (MAPO_DONG_CODES dict id 동일 — 6 모듈) ## 보류 (별 PR) - E1 dong_code String(8)/(10) 통일 — alembic 마이그레이션 + ORM 8+ 곳 변경 (별 PR `IM3-dong-code-string-unify`) - C5 SimulationInput 처리 (이번 PR 에 통합됨) - C6 새벽 4시 강제 휴식 — 정책 결정 필요 - B2 corp_brand_resolver 재도입 — 팀 합의 후 ## DB 변경 없음. 코드 fix + Pydantic 검증 강화만. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
전수조사 (2026-05-05) 결과 4 영역 (DB / 업종 / ABM / 법률) 발견 문제 일괄 fix. 3 병렬 sub-agent 작업 통합.
Fix 내역
ABM 시뮬 (simulation/)
male/female_70_74100% NULL 회피 + COALESCE 가드skipped_no_brand카운터_TIME_ZONE_TO_HOURS6구간 → 24h 확장 (daily boost dict swap 정합)법률 (agents/legal/, agents/nodes/legal.py)
DB / dong_resolver / schemas
resolve_dong_code(default=None)시그니처 + helper 추가검증
ruff check/format수정 파일 통과test_legal_orchestrator12 PASStest_runner_day_loop_boost3 PASStest_living_pop_loader3 PASStest_vacancy_pse_brand4 PASS보류 (별 PR)
IM3-dong-code-string-unifyDB 변경
없음. 코드 fix + Pydantic 검증 강화만.
🤖 Generated with Claude Code